import request from '@/utils/request'

// 查询所有仓库列表（用于下拉框）
export function listWarehouse() {
  return request({
    url: '/warehouse/warehousemanagement/listAll', // 修正为与后端一致
    method: 'get'
  });
}

// 查询仓库管理列表（带分页和条件查询）
export function listWarehousemanagement(query) {
  return request({
    url: '/warehouse/warehousemanagement/list', // 修正为/list
    method: 'get',
    params: query
  })
}

// 查询仓库管理详细
export function getWarehousemanagement(id) {
  return request({
    url: '/warehouse/warehousemanagement/' + id,
    method: 'get'
  })
}

// 新增仓库管理
export function addWarehousemanagement(data) {
  return request({
    url: '/warehouse/warehousemanagement',
    method: 'post',
    data: data
  })
}

// 修改仓库管理
export function updateWarehousemanagement(data) {
  return request({
    url: '/warehouse/warehousemanagement',
    method: 'put',
    data: data
  })
}

// 删除仓库管理
export function delWarehousemanagement(id) {
  return request({
    url: '/warehouse/warehousemanagement/' + id,
    method: 'delete'
  })
}